package com.eureka.client.demo;

import com.eureka.client.demo.lancher.RequestHeaderServiceLancherHandler;
import com.eureka.client.demo.lancher.ServiceLancherHandlerChain;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients(basePackages = {"com.eureka.client.demo.feign"})
public class DemoApplication {

    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }

    @Bean
    ServiceLancherHandlerChain serviceLancherHandlerChain(){
        ServiceLancherHandlerChain chain = new ServiceLancherHandlerChain();
        chain.addHandler(new RequestHeaderServiceLancherHandler());
        return chain;
    }
}
